package demo;

import java.util.Arrays;

public class ZuoYe01 {
	public static void main(String[] args) {
		int a[]={5,2,7,9,8,10,1,3};
		for(int i=1;i<a.length;i++){
			int num=a[i];
			int j=i-1;
			while(j>=0 && a[j]>num){
					a[j+1]=a[j];
					j--;
				}
			a[j+1]=num;
			System.out.println(Arrays.toString(a));
		}
	}
}
